var viewModels;
(function (viewModels) {
    var Page1VM = (function () {
        var self = this;
        function Page1VM() {
            self.num = ko.observable("0");
            self.confirmationVisible = ko.observable(false);
            self.forPayload = ko.observable({ text: "Hello from payload! haha" });
        }
        Page1VM.prototype.showMagicNumber = function () {
            self.num(Math.floor(Math.random() * 100).toString());
        };
        Page1VM.prototype.canNavigateFrom = function (callback) {
            self.currentCallback = callback;
            self.confirmationVisible(true);
        };
        Page1VM.prototype.confirmYes = function () {
            self.currentCallback(true);
            self.confirmationVisible(false);
        };
        Page1VM.prototype.confirmNo = function () {
            self.currentCallback(false);
            self.confirmationVisible(false);
        };
        return Page1VM;
        })(Page1VM);
    viewModels.Page1VM = Page1VM;

    var Page2VM = (function () {
        var self = this;
        function Page2VM() {
            self.num = ko.observable("0");
            self.params = ko.observable({});
        }
        Page2VM.prototype.showMagicNumber = function () {
            self.num("P2:" + Math.floor(Math.random() * 100));
        };
        Page2VM.prototype.onNavigatedTo = function (params, payload) {
            self.params(params);
        };
        return Page2VM;
    })(Page2VM);
    viewModels.Page2VM = Page2VM;

    var Page3VM = (function () {
        var self = this;
        function Page3VM() {
            self.num = ko.observable("0");
            self.params = ko.observable({});
            self.payload = ko.observable(null);
        }
        Page3VM.prototype.showMagicNumber = function () {
            self.num("P3:" + Math.floor(Math.random() * 11));
        };
        Page3VM.prototype.onNavigatedTo = function (params, payload) {
            self.payload(ko.toJSON(payload));
        };
        Page3VM.prototype.onNavigatedFrom = function () {
            alert("Page 3 Left");
        };
        return Page3VM;
    })(Page3VM);
    viewModels.Page3VM = Page3VM;

})(viewModels || (viewModels = {}));